package org.longgang.dao;

import java.util.List;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.longgang.bean.Admin;
import org.springframework.stereotype.Repository;

/**
 * AdminDAO继承基类
 */
@Repository
@Mapper
public interface AdminDAO extends MyBatisBaseDao<Admin, Integer> {
	
	@Insert("INSERT INTO admin(`name`,`password`,`b1`) VALUES(#{name},#{password},#{b1})")
	Integer insertAdmin(Admin info);
	
	@Select({ "select `adminid` from admin where `name`=#{name} and `password`=#{password} " })
	Integer selectAdminId(Admin info);
	
	@Select({ "select * from admin where `b1`=#{b1} " })
	List<Admin> selectAllAdmin(Admin info);
	
	@Update({ "update admin set `b1`=#{b1} where `adminid`=#{adminid}" })
	Integer updateAdmin(Admin info);

	@Select({ "select * from admin where `adminid`=#{adminid} " })
	Admin selectAdminById(Admin info);
}